<!DOCTYPE html>
<html>
<head>
    <title>文件上传</title>
</head>

<body>
    <h2>文件上传</h2>
    <form action="/upload" method="POST" name="form1" enctype="multipart/form-data">
        <label for="file1">选择第一个文件：</label>
        <input type="file" name="file1" id="file1" accept=".docx"><br><br>

        <label for="file2">选择第二个文件：</label>
        <input type="file" name="file2" id="file2" accept=".docx"><br><br>

{#        <input type="file" name="picpath" id="picpath" style="display:none;" onChange="changeAgentContent()">#}
{#        <input type="button" value="上传照片" onclick="document.form1.picpath.click()">#}
{#        <label name="path" id="path" readonly>未选择文件</label> <br><br>#}

        <input type="submit" value="提交">
    </form>

    {% if download_url %}
        <p>下载路径：<a href="/download/{{ download_url }}">{{ download_url }}</a></p>
    {% endif %}
</body>
</html>

{#<script type="text/javascript">#}
{#    function changeAgentContent() {#}
{#        alert(document.getElementById("picpath").value)#}
{##}
{#        var filename = document.getElementById("picpath").value#}
{#        filename = filename.lastIndexOf("\\") >= 0 ? filename.substring(filename.lastIndexOf("\\")+1) : filename;#}
{#        document.getElementById("path").innerHTML  = filename;#}
{#    }#}
{#</script>#}


